<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: S&amp;P Stock Market Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for Smarket"><tr><td>Smarket</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>S&amp;P Stock Market Data

</h2>

<h3>Description</h3>

<p>Daily percentage returns for the S&amp;P 500 stock index
between 2001 and 2005. 

</p>


<h3>Usage</h3>

<pre>Smarket</pre>


<h3>Format</h3>

<p>A data frame with 1250 observations on the following 9 variables.
</p>

<dl>
<dt><code>Year</code></dt><dd><p>The year that the observation was recorded</p>
</dd>
<dt><code>Lag1</code></dt><dd><p>Percentage return for previous day</p>
</dd>
<dt><code>Lag2</code></dt><dd><p>Percentage return for 2 days previous</p>
</dd>
<dt><code>Lag3</code></dt><dd><p>Percentage return for 3 days previous</p>
</dd>
<dt><code>Lag4</code></dt><dd><p>Percentage return for 4 days previous</p>
</dd>
<dt><code>Lag5</code></dt><dd><p>Percentage return for 5 days previous</p>
</dd>
<dt><code>Volume</code></dt><dd><p>Volume of shares traded (number of daily shares
traded in billions)</p>
</dd>
<dt><code>Today</code></dt><dd><p>Percentage return for today</p>
</dd>
<dt><code>Direction</code></dt><dd><p>A factor with levels <code>Down</code> and
<code>Up</code> indicating whether the market had a positive or negative
return on a given day</p>
</dd>
</dl>



<h3>Source</h3>

<p>Raw values of the S&amp;P 500 were obtained from Yahoo Finance and
then converted to percentages and lagged.

</p>


<h3>References</h3>

<p>James, G., Witten, D., Hastie, T., and Tibshirani, R. (2013)
<em>An Introduction to Statistical Learning with applications in R</em>,
<a href="www.StatLearning.com">www.StatLearning.com</a>,
Springer-Verlag, New York
</p>


<h3>Examples</h3>

<pre>
summary(Smarket)
lm(Today~Lag1+Lag2,data=Smarket)
</pre>


</body></html>
